package org.droid.campus.db;

import java.sql.Connection;
import java.sql.DriverManager;


public class DBconn {
	public static DBconn db = null;
	String driver = "com.mysql.jdbc.Driver";

	// URL指向要访问的数据库名scutcs
	String url = "jdbc:mysql://208.87.242.117:3306/campusorder?user=root&password=sojex123&characterEncoding=utf-8";

	// MySQL配置时的用户名
	String user = "root";

	// MySQL配置时的密码
	String password = "sojex123";

	public static DBconn getIns() {
		if (db == null) {
			db = new DBconn();
		}
		return db;
	}

	public DBconn() {
	}

	public Connection getConn() {
		try{
	    Class.forName(driver);
        // 连续数据库
        Connection conn = DriverManager.getConnection(url);
        return conn;
		}catch(Exception e){
			e.printStackTrace();
		}
		return null;
	}
}
